import Vue from 'vue'
import App from './App'
import store from './stores'
import cuCustom from './colorui/components/cu-custom.vue'
import areaData from './utils/area-data-min'
import fetch from './utils/fetch.js';
import uniUpLoadFile from './utils/uploadImg.js';
import {
	sexPicker,
	marriagePicker,
	xueliPicker,
	carPicker,
	shebaoPick,
	housePicker,
	smokePicker,
	drinkPicker,
	childrenPicker,
	marrytimePicker,
	agePicker,
	heightPicker
} from '@/utils/constant.js'
import {router,RouterMount} from './router.js'
Vue.use(router)
Vue.component('cu-custom', cuCustom)

const msg = (title, duration = 1500, mask = false, icon = 'none') => {
	//统一提示方便全局修改
	if (Boolean(title) === false) {
		return;
	}
	uni.showToast({
		title,
		duration,
		mask,
		icon
	});
}

Vue.prototype.sexPicker = sexPicker
Vue.prototype.marriagePicker = marriagePicker
Vue.prototype.xueliPicker = xueliPicker
Vue.prototype.shebaoPick = shebaoPick
Vue.prototype.housePicker = housePicker
Vue.prototype.smokePicker = smokePicker
Vue.prototype.drinkPicker = drinkPicker
Vue.prototype.childrenPicker = childrenPicker
Vue.prototype.marrytimePicker = marrytimePicker
Vue.prototype.carPicker = carPicker
Vue.prototype.agePicker = agePicker
Vue.prototype.heightPicker = heightPicker


Vue.config.productionTip = false

Vue.prototype.$feach = fetch;

Vue.prototype.$api = {
	areaData,
	msg,
	uniUpLoadFile
};

Vue.prototype.$host = 'https://www.zhugezg.com/xq/xqApp/';

Vue.prototype.$store = store;


App.mpType = 'app'

const app = new Vue({
	...App
})


//v1.3.5起 H5端 你应该去除原有的app.$mount();使用路由自带的渲染方式
// #ifdef H5
	RouterMount(app,router,'#app')
// #endif

// #ifndef H5
	app.$mount(); //为了兼容小程序及app端必须这样写才有效果
// #endif